import 'package:flutter/material.dart';

class Home extends StatefulWidget {
  Home({Key? key}) : super(key: key);

  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        ElevatedButton(
            child: Text("跳转到搜索页面"),
            onPressed: () {
              //路由跳转
              Navigator.pushNamed(context, '/search', arguments: {"id": 123});
            }),
        SizedBox(height: 20),
        ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(context, "/product");
            },
            child: Text("跳转到商品页面"))
      ],
    );
  }
}
